<%@ page language="java" import="java.util.*,com.model.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
.public_table tr td{
	width:100px;
	text-align:center;
}
.public_table tr td img{
	width:100px;
	height:100px;
}
.public_table .table_head td{
	background:lightblue;
}
</style>
<title>商品发布</title>
</head>
<body>
<jsp:useBean id="business" class="com.model.Business" scope="session"></jsp:useBean>
<jsp:setProperty property="*" name="business"/>
<h3><%=business.getBusinessName()%>您好!欢迎发布商品信息</h3>
<form action="goods_public.jsp" method ="post">
	<input type="text" value="${business.getBusinessId()}" name="businessId" style="display:none">
	<input type="submit" value="发布新的商品">
</form>
<table border="1" class="public_table">
	<tr class="table_head">
		<td>序号</td><td>名称</td><td>样图</td><td>价格</td><td>种类</td><td>详情</td><td>操作</td>
	</tr>
	<c:forEach items="${goodsList}"  var="goodsItem"  varStatus="goodsStatus">
		<tr>
			<td>${goodsStatus.count}</td>
			<td>${goodsItem.getGoodsName()}</td>
			<td><img src="${goodsItem.getGoodsImg()}"/></td>
			<td>${goodsItem.getGoodsPrice()}元</td>
			<td>${goodsItem.getGoodsType()}</td>
			<td>${goodsItem.getDesc()}</td>
			<td>
				<form action="goods_desc.jsp" method="post">
					<input type="text" value="${goodsStatus.count}" name="index" style="display:none">
					<input type="text" value="${business.getBusinessId()}" name="businessId" style="display:none">
					<input type="submit" value="修改">
				</form>
				<form action="delete" method="post">
					<input type="text" value="${goodsItem.getGoodsId()}" name="goodsId" style="display:none">
					<input type="text" value="${business.getBusinessId()}" name="businessId" style="display:none">
					<input type="submit" value="删除">
				</form>
			</td>
		</tr>
	</c:forEach>
</table>
</body>
</html>